FROM php:7.3-fpm

# 拷贝扩展安装脚本
COPY extensions.sh /usr/local/bin/extensions.sh
RUN chmod +x /usr/local/bin/extensions.sh

# 执行扩展安装
RUN /usr/local/bin/extensions.sh

# 拷贝 PHP 配置
COPY php.ini /usr/local/etc/php/php.ini

# 创建日志目录 & 指定用户及组 & 赋予权限
RUN mkdir -p /var/log/php \
    && chown -R www-data:www-data /var/log/php \
    && chmod -R 755 /var/log/php

# 安装 Composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer

WORKDIR /var/www/html



